///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
#include <Math/Vec2f.h>
#include <cmath>

//-----------------------------------------------------------------------------

Vec2f::Vec2f ( )
{
	set ( 0, 0 );
}

//-----------------------------------------------------------------------------

Vec2f::Vec2f ( const f32& x, const f32& y )
{
	set ( x, y );
}

//-----------------------------------------------------------------------------

void Vec2f::set ( const f32& x, const f32& y )
{
	this->x = x;
	this->y = y;
}

//-----------------------------------------------------------------------------

void Vec2f::setX ( const f32& x )
{
	this->x = x;
}

//-----------------------------------------------------------------------------

void Vec2f::setY ( const f32& y )
{
	this->y = y;
}

//-----------------------------------------------------------------------------

f32 Vec2f::getX ()
{
	return x;
}

//-----------------------------------------------------------------------------

f32 Vec2f::getY ()
{
	return y;
}

//-----------------------------------------------------------------------------

f32 Vec2f::norm () 
{
	return sqrt( x*x + y*y );
}

//-----------------------------------------------------------------------------

void Vec2f::normalize ( )
{
	f32 n = norm ();
	x /= n;
	y /= n;
}

//-----------------------------------------------------------------------------

void Vec2f::add ( const Vec2f& v )
{
	x += v.x;
	y += v.y;
}

//-----------------------------------------------------------------------------

void Vec2f::scale ( const f32& s )
{
	x *= s;
	y *= s;
}

//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
